home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
challenge
/
12.09-Sep96
/
Testcode96.09R2.sit
/
Testcode96.09R2
/
README MiniVM Test Code
next >
Wrap
Text File
|
1996-08-28
|
3KB
|
54 lines
Enclosed are 4 test cases for the September 1996 Programmer's Challenge
Three of the test cases are Applets created with Symantec Cafe. The
fourth is an application created with Cafe.
The JavaMiniVM.µ project parses each of the class files, calls one of
the methods, and compares the result to an expected value.
Each test case includes a .dmp file created by Symantec's DumpClass
routine containing a disassembly of the class file.
Note that these are representative test cases only. The Challenge
test code may stress your code in ways these cases do not. Feel free
to write your own applets following these examples.
REVISION 1, 20 Aug 96
- removed a call to a java/awt/Component method inadvertently left in
the swarm example
- corrected the Fib example so it does not require input parameters
- added a few opcodes to the MiscByteCodes example (invokenonvirtual,
tableswitch)
- corrected the parsing logic for the constant pool so it correctly
deals with 8 byte constants
NOTE: Your miniVM is expected to set up the execution frame for the
class called by the test code. In a full VM implementation, this
would involve allocating space for local variables and the operand
stack, as well as running the default constructor for your class. In
the Challenge, class variables will be initialized explicitly in code;
you don't need to worry about a constructor. You _do_ need to create
an object reference to your class before beginning execution. (See
the first instruction, aload_0, in the swarm.myRun method.)
REVISION 2, 28 Aug 96
- clarified the fact that an object reference is an
implementation-defined format, and requested that solutions document
the format used (Hello World example)
// The Java VM specification states:
// The specification does not require any particular internal structure for
// objects. In our implementation, an object reference is a handle, which is
// a pair of pointers: one to a method table for the object, and the other
// to the data allocated for the object. Other implementations may use inline
// caching, rather than method table dispatch ...
// Since the format of an object reference is implementation-defined, your
// solution should document the format that your miniVM uses for an object reference.
// The test code will use this information to access the data for that object and
// compare it to the expected value. Sample code to extract object data from
// your implementation-defined object reference is welcome but not required.
- removed a reference to the Math class in the swarm example
- added code to the MiscByteCodes class to generate multianewarray,
arraylength, aaload, and aastore byte codes